Jump to content

User:Mike Dillon/monobook.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// See [[User:Mike Dillon/Scripts]] for descriptions

// Proposed versions of importScript() and importStylesheet()
function buildRawUrl(page, ctype, options) {
    if (!options) options = {};
    var server = '';
    if (options.server) {
        server = "http://" + options.server;
    }
    var url = server + wgScriptPath
            + '/index.php?title='
            + encodeURIComponent( page.replace( / /g, '_' ) )
            + '&action=raw&ctype=' + ctype;
    var keys = [ "oldid", "smaxage", "maxage" ];
    for (var n in keys) {
        if (options[keys[n]]) {
            url += "&" + keys[n] + "=" + encodeURIComponent(options[keys[n]]);
        }
    }
    return url;
}

function importScript( page, options ) {
    mw.loader.load(buildRawUrl(page, 'text/javascript', options));
}

function importStylesheet( page, options ) {
    importStylesheetURI(buildRawUrl(page, 'text/css', options));
}

// [[User:Mike Dillon/Scripts/params.js]]
importScript('User:Mike Dillon/Scripts/params.js', { "server": "en.wiktionary.org", "smaxage": 604800 });

// [[User:Mike Dillon/Scripts/cookies.js]]
importScript('User:Mike Dillon/Scripts/cookies.js', { "server": "en.wiktionary.org", "smaxage": 604800 });

// [[User:Mike Dillon/Scripts/i18n.js]]
importScript('User:Mike Dillon/Scripts/i18n.js', { "server": "en.wiktionary.org", "smaxage": 604800 });

// [[User:Mike Dillon/Scripts/namespaces.js]]
importScript('User:Mike Dillon/Scripts/namespaces.js', { "smaxage": 604800 });

// [[User:Mike Dillon/Scripts/username.js]]
importScript('User:Mike Dillon/Scripts/username.js', { "server": "en.wiktionary.org", "smaxage": 604800 });

// [[User:Mike Dillon/Scripts/build-urls.js]]
importScript('User:Mike Dillon/Scripts/build-urls.js', { "server": "en.wiktionary.org", "smaxage": 604800 });

// [[User:Mike Dillon/Scripts/easydom.js]]: defines functional interface for building DOM trees
//importScript('User:Mike Dillon/Scripts/easydom.js', { "server": "en.wiktionary.org", "smaxage": 604800 });
importScript('User:Mike Dillon/Scripts/easydom-dev.js', { "server": "en.wiktionary.org", "smaxage": 604800 });

// [[User:Mike Dillon/Scripts/addlilink.js]]: defines addlilink() and addToolboxLink()
importScript('User:Mike Dillon/Scripts/addlilink.js', { "smaxage": 604800 });

// [[User:Mike Dillon/Scripts/duplicateTabs.js]]: duplicates tabs to bottom
importScript('User:Mike Dillon/Scripts/duplicateTabs.js', { "server": "en.wiktionary.org", "smaxage": 604800 });

// [[User:Mike Dillon/Scripts/tabs.js]]: defines addTab(); creates custom tabs
importScript('User:Mike Dillon/Scripts/tabs.js', { "server": "en.wiktionary.org", "smaxage": 604800 });

// [[User:Mike Dillon/Scripts/searchNewWindow.js]]
importScript('User:Mike Dillon/Scripts/searchNewWindow.js', { "server": "en.wiktionary.org", "smaxage": 604800 });

// [[User:Mike Dillon/Scripts/toolbox.js]]: defines addToolboxLink()
importScript('User:Mike Dillon/Scripts/toolbox.js', { "server": "en.wiktionary.org", "smaxage": 604800 });

// [[User:Mike Dillon/Scripts/popups.js]]: Popups
var alertArticleRegex = false;

//var simplePopups = false;
var popupDelay = 1.5;
//var popupAdminLinks = true;
var popupNavLinks = true;
var popupSummaryData = true;
var popupFixRedirs = true;
var popupFixDabs = true;
var popupLastModified = true;
//var popupStructure = 'original';

importScript('User:Mike Dillon/Scripts/popups.js', { "smaxage": 604800 });

// [[User:Zocky/PicturePopups.js]]: Picture Popups
importScript('User:Zocky/PicturePopups.js', {
    "smaxage": 604800,
    "oldid": 93863610
});

// [[User:Mike Dillon/Scripts/defaultsort.js]]
importScript('User:Mike Dillon/Scripts/defaultsort.js', { "server": "en.wiktionary.org", "smaxage": 604800 });

// [[User:Mike Dillon/Scripts/recentpages.js]]
importScript('User:Mike Dillon/Scripts/recentpages.js', { "server": "en.wiktionary.org", "smaxage": 604800 });

// [[User:Mike Dillon/Scripts/convert-brewbox.js]]
importScript('User:Mike Dillon/Scripts/convert-brewbox.js');